{include file="news/header.tpl"} {literal}
<script type="text/javascript" language="javascript">  
        $(document).ready(function() {  
        	$("#chk_all").click( 
       			 function(){ 
       				if(this.checked){ 
       				 $("input[name='chk_list']").attr('checked', true) 
       				 }else{ 
       				$("input[name='chk_list']").attr('checked', false) 
       				} 
       				} 
       				);
                  });   
     
            function xiugai(cid){
            $("#"+cid).addClass("ed");
            var n=$("#"+cid+"_realname").html();
            var m=$("#"+cid+"_sj").html();
            var a=$("#"+cid+"_amount").html();
            var c=$("#"+cid+"_comment").html();
            $("#comment").val(c);
            $("input[name='amount']").val(a);
            $("input[name='comment_id']").val(cid);
            $("input[name='real_name']").val(n);
            $("input[name='mobile_phone']").val(m);
            
              $("#xiugai").show();
            }
            function act(name){

                var arrChk=$("input[name='chk_list']:checked");
              	 var ids='';
              	 var cid=$("select[name='category']").val(); 
         var flag=confirm('确认操作?');
                
                if(flag==false){
                    return false;
                }
                var action;
                if(name=="pass"){
                 action="通过";
                }else{
                   action="屏蔽";
                 }

                $(arrChk).each(function(){
            	     ids=ids+','+this.value;  
            	     $("#"+this.value+"_pd").html(action);                      
            	  }); 

              	 $.post("/comment/cstatus",{ids:ids,cid:cid,type:name},function(data){
                        alert(data.message);  
                      
                       // window.location.reload();
            	 },"json");
        	   
        	  
             } 
            function savexiugai(){
          	  var id= $("input[name='comment_id']").val();
              var n=$("input[name='real_name']").val();
              var m=$("input[name='mobile_phone']").val();
              var a=$("input[name='amount']").val();
              var c=$("#comment").val();
              
              $.post("/comment/savecommentstatus",{id:id,real_name:n,mobile_phone:m,amount:a,comment:c},function(json){
                    if(json.status==true){
                        alert(json.error);
                   	$("#"+id+"_realname").html(n);
                    $("#"+id+"_sj").html(m);
                    $("#"+id+"_amount").html(a); 
                    $("#"+id+"_comment").html(c);         
                     }
               },"json")
            }
     

            function recyle(id){  
              if(!confirm("确认删除?")){
                     return;
                }
          	  $.post("/comment/remove",{id:id,nid:32416},function(json){
                  if(json.status==true){
                    
               	   $("#"+id).fadeOut();
                   }
             },"json")
          } 
            
            
    </script>

{/literal}

<!-- 头部// -->
{include file="news/top.tpl"} {include file="news/nav.tpl"}
<!-- start: Content -->
<div id="content" class="span10">


<div class="row-fluid">


<div class="box span12"><!-- Default panel contents -->



<div class="well">


<form name="news" action="/comment/search" method="post"
	class="form-inline"><input type="checkbox" name="chk_all" id="chk_all"
	class="checkbox" />{$lang['SELECTALL']} <input type=button name=copy
	class="btn btn-success" value="{$lang['PASS']}" onclick="act('pass');">

<input type=button name=copy class="btn btn-default"
	value="屏蔽" onclick="act('refuse');"> <select name="type"
	class="input-medium">
	<option value="real_name">{$lang['USERNAME']}</option>
	<option value="mobile_phone">{$lang['MOBILE']}</option>
</select> <input value="" type="text" class="control" name="value">
<button type="submit" class="btn btn-primary"><i class="icon-search"></i>
</button>
<!--标题:<input value="" name="title"> <input type="submit" class="imgbutton" value="搜索">-->
<span class="pull-right text-info">{$totalnum}</span></form>

<table class="table table-striped table-hover">

	<tr>
		<th class="span1"></th>
		<th class="span1">{$lang['STATUS']}</th>
		<th class="span2"></th>
		<th class="span1">{$lang['USERNAME']}</th>
		<th class="span2"></th>
		<th class="span3">{$lang['CONTENT']}</th>
		<th class="span2">

		<div class="btn-group"><a class="btn dropdown-toggle"
			data-toggle="dropdown" href="#"> {$lang['CATE']} <span class="caret"></span>
		</a>
		<ul class="dropdown-menu">
			<!-- dropdown menu links -->
			<li><a href="/comment/clist/?cid=0">{$lang['ALL']}</a></li>
			{foreach from=$cate item=l key=key}
			<li><a href="/comment/clist/?cid={$key}">{$l}</a></li>
			{/foreach}
		</ul>
		</div>
		</th>
		<th class="span1"></th>
	</tr>



	{section name=l loop=$news }
	<tr id="{$news[l].id}">
		<td><input type=checkbox name=chk_list value="{$news[l].id}"
			class="checkbox" id="box_{$news[l].id}"></td>
		<td><a href="javascript:void(0)" id="{$news[l].id}_pd">{if
		$news[l].status=="未审核"}<span class="label label-info"><i
			class="icon-time"></i></span>{elseif $news[l].status=="拒绝"}<span
			class="label"><i class="icon-ban-circle"></i></span> {/if}</a></td>
		<td><small>{$news[l].date|wtime}</small></td>

		<td id="{$news[l].id}_realname">{$news[l].real_name}</td>
		<td><span id="{$news[l].id}_sj">{$news[l].mobile_phone}</span></td>
		<td><a href="/news/v/?id={$news[l].nid}" target="__blank"><span
			id="{$news[l].id}_comment">{$news[l].comment}</span></a> <small><cite
			title="Source Title">{$news[l].country}</cite></small></td>

		<td><a href="/comment/clist/?cid={$news[l].nid}">{$news[l].title|cntruncate:"5"}</td>
		<td class=left><a href="javascript:void(0)" title="回收站"
			onclick="recyle({$news[l].id})"><i class="icon-trash "></i></a></td>

	</tr>
	{/section}

</table>


<div class="pagination pagination-centered">
<ul id="pager"></ul>
</div>

</div>




{literal} <script type='text/javascript'>
var options = {
currentPage: {/literal}{$num.current}{literal},
totalPages: {/literal}{$num.page}{literal},
numberOfPages:5,
bootstrapMajorVersion:3,
pageUrl: function(type, page, current){
    return '/comment/clist/?p='+page+'&cid={/literal}{$nid}{literal}'
}
}
$('#pager').bootstrapPaginator(options);
</script> {/literal} {include file="news/footer.tpl"}